<template>
	<van-switch
	  v-model="curValue"
	  :disabled="disabled"
	/>
</template>

<script lang="ts">
import { Vue, Component, Prop, Provide, Emit, Watch } from 'vue-property-decorator';

@Component({
    components: {
    }
})
export default class Appswitch extends Vue {
    
		/**
         * checked选中状态
         *
         * @type {boolean}
         * @memberof Appswitch
         */
        @Prop() public value?: boolean;
        
        get curValue(){
            return this.value === '1'?true:false;
        }

        set curValue(value:any){
            let emitValue = value ===true?'1':'0';
            this.$emit('valuechange',emitValue);
        }

		/**
         * 禁用
         *
         * @type {boolean}
         * @memberof Appswitch
         */
		@Prop() public disabled?: boolean;
	    
 	}
</script>
<style  lang="less">


</style>